<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLaravelExtendAuthTokenTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('auth_token');
        Schema::create('auth_token', function (Blueprint $table) {
            $table->string('id',36)->primary();
            $table->string('user_id',36)->index()->comment('用户ID');
            $table->string('model')->index()->comment('用户模型');
            $table->string('platform',60)->default('')->index()->comment('登录平台');
            $table->string('source',60)->default('')->comment('登录平台标识');
            $table->string('client_ip',60)->default('')->comment('登录IP');
            $table->string('expire_time')->comment('过期时间');
            $table->dateTime('created_at')->nullable();
            $table->dateTime('updated_at')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('auth_token');
    }
}
